
#include "common/runtime/Hash.hpp"
#include "vectorwise/Operations.hpp"
#include "vectorwise/Primitives.hpp"
#include <functional>

using namespace types;
using namespace std;

namespace vectorwise {
namespace primitives {

#define MK_SCATTER(type)                                                       \
   FScatter scatter_##type##_col = (FScatter)&scatter<type>;
#define MK_SCATTER_SEL(type)                                                   \
   FScatterSel scatter_sel_##type##_col = (FScatterSel)&scatter_sel<type>;
#define MK_SCATTER_SEL_ROW(type)                                               \
   FScatterSelRow scatter_sel_row_##type##_col =                               \
       (FScatterSelRow)&scatter_sel_row<type>;

#define MK_GATHER_COL(type)                                                    \
   FGather gather_col_##type##_col = (FGather)&gather_col<type>;
#define MK_GATHER_SEL_COL(type)                                                \
   FGatherSel gather_sel_col_##type##_col = (FGatherSel)&gather_sel_col<type>;
#define MK_GATHER_VAL(type)                                                    \
   FGatherVal gather_val_##type##_col = (FGatherVal)&gather_val<type>;

//EACH_TYPE(NIL, MK_SCATTER)
FScatter scatter_Date_col = (FScatter)&scatter<Date>;
FScatter scatter_Char_1_col = (FScatter)&scatter<Char_1>;
FScatter scatter_Char_6_col = (FScatter)&scatter<Char_6>;
FScatter scatter_Char_7_col = (FScatter)&scatter<Char_7>;
FScatter scatter_Char_9_col = (FScatter)&scatter<Char_9>;
FScatter scatter_Char_10_col = (FScatter)&scatter<Char_10>;
FScatter scatter_Char_12_col = (FScatter)&scatter<Char_12>;
FScatter scatter_Char_15_col = (FScatter)&scatter<Char_15>;
FScatter scatter_Char_25_col = (FScatter)&scatter<Char_25>;
FScatter scatter_hash_t_col = (FScatter)&scatter<hash_t>;
FScatter scatter_int32_t_col = (FScatter)&scatter<int32_t>;
FScatter scatter_int64_t_col = (FScatter)&scatter<int64_t>;
FScatter scatter_int8_t_col = (FScatter)&scatter<int8_t>;
FScatter scatter_int16_t_col = (FScatter)&scatter<int16_t>;

//EACH_TYPE(NIL, MK_SCATTER_SEL)
FScatterSel scatter_sel_Date_col = (FScatterSel)&scatter_sel<Date>;
FScatterSel scatter_sel_Char_1_col = (FScatterSel)&scatter_sel<Char_1>;
FScatterSel scatter_sel_Char_6_col = (FScatterSel)&scatter_sel<Char_6>;
FScatterSel scatter_sel_Char_7_col = (FScatterSel)&scatter_sel<Char_7>;
FScatterSel scatter_sel_Char_9_col = (FScatterSel)&scatter_sel<Char_9>;
FScatterSel scatter_sel_Char_10_col = (FScatterSel)&scatter_sel<Char_10>;
FScatterSel scatter_sel_Char_12_col = (FScatterSel)&scatter_sel<Char_12>;
FScatterSel scatter_sel_Char_15_col = (FScatterSel)&scatter_sel<Char_15>;
FScatterSel scatter_sel_Char_25_col = (FScatterSel)&scatter_sel<Char_25>;
FScatterSel scatter_sel_hash_t_col = (FScatterSel)&scatter_sel<hash_t>;
FScatterSel scatter_sel_int32_t_col = (FScatterSel)&scatter_sel<int32_t>;
FScatterSel scatter_sel_int64_t_col = (FScatterSel)&scatter_sel<int64_t>;
FScatterSel scatter_sel_int8_t_col = (FScatterSel)&scatter_sel<int8_t>;
FScatterSel scatter_sel_int16_t_col = (FScatterSel)&scatter_sel<int16_t>;

//EACH_TYPE(NIL, MK_SCATTER_SEL_ROW)
FScatterSelRow scatter_sel_row_Date_col =
    (FScatterSelRow)&scatter_sel_row<Date>;
FScatterSelRow scatter_sel_row_Char_1_col =
    (FScatterSelRow)&scatter_sel_row<Char_1>;
FScatterSelRow scatter_sel_row_Char_6_col =
    (FScatterSelRow)&scatter_sel_row<Char_6>;
FScatterSelRow scatter_sel_row_Char_7_col =
    (FScatterSelRow)&scatter_sel_row<Char_7>;
FScatterSelRow scatter_sel_row_Char_9_col =
    (FScatterSelRow)&scatter_sel_row<Char_9>;
FScatterSelRow scatter_sel_row_Char_10_col =
    (FScatterSelRow)&scatter_sel_row<Char_10>;
FScatterSelRow scatter_sel_row_Char_12_col =
    (FScatterSelRow)&scatter_sel_row<Char_12>;
FScatterSelRow scatter_sel_row_Char_15_col =
    (FScatterSelRow)&scatter_sel_row<Char_15>;
FScatterSelRow scatter_sel_row_Char_25_col =
    (FScatterSelRow)&scatter_sel_row<Char_25>;
FScatterSelRow scatter_sel_row_hash_t_col =
    (FScatterSelRow)&scatter_sel_row<hash_t>;
FScatterSelRow scatter_sel_row_int32_t_col =
    (FScatterSelRow)&scatter_sel_row<int32_t>;
FScatterSelRow scatter_sel_row_int64_t_col =
    (FScatterSelRow)&scatter_sel_row<int64_t>;
FScatterSelRow scatter_sel_row_int8_t_col =
    (FScatterSelRow)&scatter_sel_row<int8_t>;
FScatterSelRow scatter_sel_row_int16_t_col =
    (FScatterSelRow)&scatter_sel_row<int16_t>;

//EACH_TYPE(NIL, MK_GATHER_COL)
FGather gather_col_Date_col = (FGather)&gather_col<Date>;
FGather gather_col_Char_1_col = (FGather)&gather_col<Char_1>;
FGather gather_col_Char_6_col = (FGather)&gather_col<Char_6>;
FGather gather_col_Char_7_col = (FGather)&gather_col<Char_7>;
FGather gather_col_Char_9_col = (FGather)&gather_col<Char_9>;
FGather gather_col_Char_10_col = (FGather)&gather_col<Char_10>;
FGather gather_col_Char_12_col = (FGather)&gather_col<Char_12>;
FGather gather_col_Char_15_col = (FGather)&gather_col<Char_15>;
FGather gather_col_Char_25_col = (FGather)&gather_col<Char_25>;
FGather gather_col_hash_t_col = (FGather)&gather_col<hash_t>;
FGather gather_col_int32_t_col = (FGather)&gather_col<int32_t>;
FGather gather_col_int64_t_col = (FGather)&gather_col<int64_t>;
FGather gather_col_int8_t_col = (FGather)&gather_col<int8_t>;
FGather gather_col_int16_t_col = (FGather)&gather_col<int16_t>;

//EACH_TYPE(NIL, MK_GATHER_SEL_COL)
FGatherSel gather_sel_col_Date_col = (FGatherSel)&gather_sel_col<Date>;
FGatherSel gather_sel_col_Char_1_col = (FGatherSel)&gather_sel_col<Char_1>;
FGatherSel gather_sel_col_Char_6_col = (FGatherSel)&gather_sel_col<Char_6>;
FGatherSel gather_sel_col_Char_7_col = (FGatherSel)&gather_sel_col<Char_7>;
FGatherSel gather_sel_col_Char_9_col = (FGatherSel)&gather_sel_col<Char_9>;
FGatherSel gather_sel_col_Char_10_col = (FGatherSel)&gather_sel_col<Char_10>;
FGatherSel gather_sel_col_Char_12_col = (FGatherSel)&gather_sel_col<Char_12>;
FGatherSel gather_sel_col_Char_15_col = (FGatherSel)&gather_sel_col<Char_15>;
FGatherSel gather_sel_col_Char_25_col = (FGatherSel)&gather_sel_col<Char_25>;
FGatherSel gather_sel_col_hash_t_col = (FGatherSel)&gather_sel_col<hash_t>;
FGatherSel gather_sel_col_int32_t_col = (FGatherSel)&gather_sel_col<int32_t>;
FGatherSel gather_sel_col_int64_t_col = (FGatherSel)&gather_sel_col<int64_t>;
FGatherSel gather_sel_col_int8_t_col = (FGatherSel)&gather_sel_col<int8_t>;
FGatherSel gather_sel_col_int16_t_col = (FGatherSel)&gather_sel_col<int16_t>;

//EACH_TYPE(NIL, MK_GATHER_VAL)
FGatherVal gather_val_Date_col = (FGatherVal)&gather_val<Date>;
FGatherVal gather_val_Char_1_col = (FGatherVal)&gather_val<Char_1>;
FGatherVal gather_val_Char_6_col = (FGatherVal)&gather_val<Char_6>;
FGatherVal gather_val_Char_7_col = (FGatherVal)&gather_val<Char_7>;
FGatherVal gather_val_Char_9_col = (FGatherVal)&gather_val<Char_9>;
FGatherVal gather_val_Char_10_col = (FGatherVal)&gather_val<Char_10>;
FGatherVal gather_val_Char_12_col = (FGatherVal)&gather_val<Char_12>;
FGatherVal gather_val_Char_15_col = (FGatherVal)&gather_val<Char_15>;
FGatherVal gather_val_Char_25_col = (FGatherVal)&gather_val<Char_25>;
FGatherVal gather_val_hash_t_col = (FGatherVal)&gather_val<hash_t>;
FGatherVal gather_val_int32_t_col = (FGatherVal)&gather_val<int32_t>;
FGatherVal gather_val_int64_t_col = (FGatherVal)&gather_val<int64_t>;
FGatherVal gather_val_int8_t_col = (FGatherVal)&gather_val<int8_t>;
FGatherVal gather_val_int16_t_col = (FGatherVal)&gather_val<int16_t>;
}
}
